From 86dce4b252005949a4f9a4f7b4666982b12a84d4 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 7 Aug 2017 14:13:30 +0100 Subject: [PATCH] ostree/parse-datetime: Ensure tm structs are initialised Otherwise tm.tm_wday remains uninitialised and gets propagated elsewhere. Spotted by Coverity as issue #209265. Signed-off-by: Philip Withnall Closes: #1059 Approved by: cgwalters --- src/ostree/parse-datetime.y | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ostree/parse-datetime.y b/src/ostree/parse-datetime.y index f5688d30..50917354 100644 --- a/src/ostree/parse-datetime.y +++ b/src/ostree/parse-datetime.y @@ -1280,8 +1280,8 @@ parse_datetime (struct timespec *result, char const *p, time_t Start; long int Start_ns; struct tm const *tmp; - struct tm tm; - struct tm tm0; + struct tm tm = { 0, }; + struct tm tm0 = { 0, }; parser_control pc; struct timespec gettime_buffer; unsigned char c; -- 2.30.2